package top.drinyeit.nongmao.activity;

import android.os.Bundle;
import android.support.v7.widget.RecyclerView;

import java.util.HashMap;
import java.util.Map;

import top.drinyeit.nongmao.R;
import top.drinyeit.nongmao.base.BaseActivity;
import top.drinyeit.nongmao.presenter.ChildrenOrderPresenter;

/**
 * Created by wu on 2018/1/11.
 */

public class ChildrenOrderActivity extends BaseActivity{
    private int parentOrderId;
    private RecyclerView mRecycler;
    private ChildrenOrderPresenter childrenOrderPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_son_order);

        initIntent();
        initView();
        initData();
    }

    private void initIntent(){
        Bundle bundle = getIntent().getExtras();
        parentOrderId = bundle.getInt("parent_order_id");
    }

    private void initView(){
        mRecycler = findViewById(R.id.mRecyclerView);
    }

    private void initData(){
        childrenOrderPresenter = new ChildrenOrderPresenter(this);
        Map<String,Object> map = new HashMap<>();
        map.put("action","commodity_children_order_list");
        map.put("parent_order_id",parentOrderId);
        childrenOrderPresenter.getChildrenOrderList(map);
    }
}
